<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--商户管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/member/css/core1.css?v=3"/>

    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="__STATIC_URL__/static/js/commen.js" type="text/javascript" charset="utf-8"></script>

</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:
                </li>
                <li><a href="javascript:history.back();">营销工具</a></li>
                <li><a href="javascript:history.back();">活动营销</a></li>
                <li class="active" style="color: #02b87f;">分组群发</li>
            </ul>
        </div>
        <div class="panel mgr15 mgl15">
            <div class="panel-heading addCharts" style="background:#ededed;">
                分组群发管理
            </div>
            <!--<div class="panel-body">-->
                <div class="panel panel-default" id="step1">
                    <div class="panel-body">
                        <div class="panel panel-default ng-scope">
                            <div class="panel-heading">
                                群发规则列表
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <td>编号</td>
                                        <td>规则名称</td>
                                        <td>群发用户分组</td>
                                        <td>群发卡券</td>
                                        <td>卡券类型</td>
                                        <td>创建时间</td>
                                        {if condition="checkPath('marke/zx_massput')"}
                                        <td class="text-center">操作</td>
                                        {/if}
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="rulelist" id="vo"}
                                    <tr ng-if="!instances.list.length" class="ng-scope">
                                        <td>{$vo.id}</td>
                                        <td>{$vo.rule_name}</td>
                                        <td>{$vo.groupid|get_user_group=###}</td>
                                        <td>{$vo.card_title}</td>
                                        <td>{$vo.card_type|getcardtype=###}</td>
                                        <td>{$vo.creattime|date="Y-m-d H:i:s",###}</td>
                                        {if condition="checkPath('marke/zx_massput')"}
                                        <td>{eq name="vo.statu" value="0"}<a class="btn-link" href="{:url('marke/zx_massput',['id'=>$vo['id']])}">执行</a>{else/}已执行{/eq}</td>
                                        {/if}
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="pull-left alert form form-area" style="width:100%; position: relative; display: block; margin-top: 0.5px;" id="form1">
                            <div class="arrow_in"></div>
                            <h4  class="card_title_detail">基本信息：</h4>
                            <!--<div class="alert alert-danger" role="alert">-->
                                <!--认证服务号可使用该功能需，且会占用每月4次的群发限额。-->
                            <!--</div>-->
                            <form class="form-horizontal adminex-form" action="" method="post">
                                <input type="hidden" name="type" id="can_type" value="1">
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 活动名称</label>
                                    <div class="col-sm-9 col-xs-12">

                                        <input type="text" class="form-control" name="rule_name">
                                        <div class="help-block">活动名称只用于管理，不显示给用户。 </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 选择要发放的分组</label>
                                    <div class="col-sm-9 col-xs-12">
                                        <select name="groupid" class="form-control" >
                                            <option value="">请选择</option>
                                            {volist name="grouplist" id="vog"}
                                            <option value="{$vog.id}">{$vog.group_name}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 选择要投放的卡券</label>
                                    <div class="col-sm-9 col-xs-12">
                                        <select name="card_id" class="form-control" >
                                            <option value="">请选择</option>
                                            {volist name="cards" id="vos"}
                                            <option value="{$vos.card_id}">{$vos.title}[卡券]</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 通知名称</label>
                                    <div class="col-sm-9 col-xs-12">

                                        <input type="text" class="form-control" name="first">
                                        <div class="help-block">活动名称显示在发送给用户的消息模板头部。 </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 最后结语</label>
                                    <div class="col-sm-9 col-xs-12">

                                        <input type="text" class="form-control" name="remark">
                                        <div class="help-block">例如：祝您生活愉快。 </div>
                                    </div>
                                </div>
                                <div style="text-align: center">
                                    <button type="submit" class="btn btn-primary">添加</button>
                                </div>
                            </form>
                        </div>
                    </div>
                <!--</div>-->
            </div>
        </div>
      {include file='public/footer'/}
    </div>
</section>
</body>
<script>


    $("#share").on('switch-change', function (e, data) {
        var $el = $(data.el), value = data.value;
        if(value==true){
            $("#can_share").val(1);
        }else{
            $("#can_share").val(0);
        }
    });
    $("#give").on('switch-change', function (e, data) {
        var $el = $(data.el), value = data.value;
        if(value==true){
            $("#can_give_friend").val(1);
        }else{
            $("#can_give_friend").val(0);
        }
    });
</script>
<script type="text/javascript">
    function upload(file,typed) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other',file);

        $.ajax({
            url: "",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            $("." + file).attr("src", res.savapath).css("display", "block");
            $(".file-"+file).val(res.other);
            $("."+typed+"-"+file).val(res.other);
        }).fail(function (res) {
            alert("上传失败")
        });
    }
</script>


</html>
